package com.hgs.annotation;

import java.lang.reflect.Method;

public class TestAnnotation {

    @HgsAnnotation(userName = "test hgs annotation hello world")
//    @HgsAnnotation
    public void printHgsAnnotation(){
        Class clazz = TestAnnotation.class;
        try {
            Method annotationMethod = clazz.getMethod("printHgsAnnotation");
            HgsAnnotation hgs = annotationMethod.getAnnotation(HgsAnnotation.class);
            System.out.println("Annotation-->"+hgs.userName());
        } catch (NoSuchMethodException e) {
            e.printStackTrace();
        }
    }

    public static void main(String[] args) {
        TestAnnotation test = new TestAnnotation();
        test.printHgsAnnotation();
    }
}
